import math

data = input().split(',')
a, b, theta = float(data[0]), float(data[1]), float(data[2])
theta = math.radians(theta)

print(math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(theta)))